package com.heima.client.schedule;

import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.common.dtos.TaskDto;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

@FeignClient("leadnews-schedule")
public interface ITaskClient {

    /**
     * 添加任务
     * @param taskDto
     * @return
     */
    @PostMapping("/api/v1/task/addTask")
    ResponseResult addTask(@RequestBody TaskDto taskDto);

    /**
     * 根据任务类型和优先级来拉取任务数据
     * @param taskType
     * @param priority
     * @return
     */
    @GetMapping("/api/v1/task/{task}")
    ResponseResult pullTask(Integer taskType, Integer priority);
}
